package com.itheima.d1_file;

import java.io.File;

public class FileTest1 {
    public static void main(String[] args) {

        //File f = new File("D:\\resourse\\a.txt");
        //File f = new File("D:/resourse/a.txt");
        File f1 = new File("D:"+File.separator+"resourse"+File.separator+"a.txt");
        System.out.println(f1.length());
        System.out.println(f1.exists());

        File f2 = new File("D:\\resourse");
        System.out.println(f2.length());

        File f3 = new File("D:\\resourse\\b.txt");
        System.out.println(f3.length());
        System.out.println(f3.exists());

        //绝对路径：带盘符的路径
        //File file4 = new File("D:\\java相关\\java项目\\code\\Javasepro\\Day17\\src\\b.txt");
        //相对路径：不带盘符的路径
        File file4 = new File("Day17\\src\\b.txt");
        System.out.println(file4.exists());
        System.out.println(file4.length());
    }
}
